xl, cpupools: Create empty pool if no cpus are specified
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Tue, 24 Apr 2012 17:51:56 +0000 (18:51 +0100)
committerGeorge Dunlap <george.dunlap@eu.citrix.com>
Tue, 24 Apr 2012 17:51:56 +0000 (18:51 +0100)
commitf7e9df6a86f37c364d77b1011a745318967b2379
tree1d1b35dfc9393b67bfbf266abce68bd7de301085
parentb010719a060e4d48607322e179579875e6ffc63e
xl, cpupools: Create empty pool if no cpus are specified

Currently, if "xl cpupool-create" is called with no cpus configured,
xl will choose a cpu at random from the list of unassigned cpus, and
if no unassigned cpus are available, it will fail.

This seems to me to be a poor interface.  For one, it makes it impossible
to create an empty cpupool using the xl command-line, except by creating
a pool and then removing the cpus from it.  For two, I don't think assigning
a random cpu is a feature; it's not unreasonable for the user to specify
which cpus to add to which pools.

This patch changes the behavior of "xl cpupool-create" to create an empty
pool if no cpus are specified.  I believe this interface to be more expected
and more script-friendly.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c